<?php

use yii\helpers\Url;
use yii\helpers\Html;
use common\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\Major */

$this->title = $model->ZYMC;
$this->params['breadcrumbs'][] = ['label' => 'Majors', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="major-view">

    <div class="panel">
		<div class="panel-heading">
            <?= Html::encode($this->title) ?>
		</div>
        <div class="panel-body">  
            <?= DetailView::widget([
                'model' => $model,
                'fieldRows' => [
                    [
                        '学校名称' => $model->xX->ZWMC,
                        '院系名称' => $model->BMID?$model->bM->BMMC:'',
                    ],[
                        '专业名称' => $model->ZYMC,
                        '专业代码' => $model->ZYDM,
                    ],[
                        '培养方案:raw' => Html::a(basename($model->PYFA), '@web/'.$model->PYFA, ['target'=>'_blank']),
                        '本校专业编号' => $model->BXZYBH,
                    ],[
                        '招生类别' => $model->ZSLB,
                        '专业目录版本' => $model->ZYMLBB,
                    ],[
                        '教学形式' => $model->JXXS,
                        '专业类别' => $model->ZYLB,
                    ],[
                        '学制' => $model->XZ,
                        '专业方向' => $model->ZYFX,
                    ],[
                        '总学分' => $model->ZXF,
                        '是否国控' => $model->SFGK?'是':'否',
                    ],[
                        '必修学分' => $model->BXXF,
                        '是否涉农专业' => $model->SFSN?'是':'否',
                    ],[
                        '开设时间' => $model->KSSJ,
                        '招生资格' => $model->ZSZG,
                    ],[
                        '撤销时间' => $model->CXSJ,
                        '状态' => $model->ZT,
                    ],[
                        '专业介绍:3' => $model->ZYJC,
                    ]
                ]
            ]) ?>
        </div>
    </div>

    <div class="panel">
		<div class="panel-heading">
            开设课程
		</div>
        <div class="panel-body">        
            <table id="t2" class="table table-hover table-bordered">
                <tr>
                    <th>序号</th>
                    <th>课程名称</th>
                    <th>课程代码</th>
                    <th>课程类别</th>
                    <th>课程性质</th>
                    <th>排课学期</th>
                    <th>学分</th>
                    <th>总学时</th>
                    <th>理论学时</th>
                    <th>实验学时</th>
                    <th>实践学时</th>
                </tr>
                <?php foreach($model->majorCourses as $mc){ $idx++; $kc=$mc->kC?>
                <tr>
                    <td><?= $idx ?></td>
                    <td><?= Html::encode($kc->KCMC) ?></td>
                    <td><?= Html::encode($kc->KCDM) ?></td>
                    <td><?= Html::encode($kc->KCLB) ?></td>
                    <td><?= Html::encode($kc->KCXZ) ?></td>
                    <td><?= Html::encode($mc->PKXQXH) ?></td>
                    <td><?= Html::encode($kc->XF) ?></td>
                    <td><?= Html::encode($kc->ZXS) ?></td>
                    <td><?= Html::encode($kc->LLXS) ?></td>
                    <td><?= Html::encode($kc->SYXS) ?></td>
                    <td><?= Html::encode($kc->SJXS) ?></td>
                </tr>
                <?php } ?>
            </table>
        </div>
	</div>
<style>
#t1 th{
    text-align:right;
}
#t2 th,#t2 td{
    text-align:center;
}
</style>
</div>
